package com.ruoyi.repn.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.repn.mapper.ServicePackageMapper;
import com.ruoyi.repn.domain.ServicePackage;
import com.ruoyi.repn.service.IServicePackageService;

/**
 * 服务套餐;Service业务层处理
 * 
 * @author cpf
 * @date 2024-03-02
 */
@Service
public class ServicePackageServiceImpl implements IServicePackageService 
{
    @Autowired
    private ServicePackageMapper servicePackageMapper;

    /**
     * 查询服务套餐;
     * 
     * @param id 服务套餐;主键
     * @return 服务套餐;
     */
    @Override
    public ServicePackage selectServicePackageById(Long id)
    {
        return servicePackageMapper.selectServicePackageById(id);
    }

    /**
     * 查询服务套餐;列表
     * 
     * @param servicePackage 服务套餐;
     * @return 服务套餐;
     */
    @Override
    public List<ServicePackage> selectServicePackageList(ServicePackage servicePackage)
    {
        return servicePackageMapper.selectServicePackageList(servicePackage);
    }

    /**
     * 新增服务套餐;
     * 
     * @param servicePackage 服务套餐;
     * @return 结果
     */
    @Override
    public int insertServicePackage(ServicePackage servicePackage)
    {
        servicePackage.setCreateTime(DateUtils.getNowDate());
        return servicePackageMapper.insertServicePackage(servicePackage);
    }

    /**
     * 修改服务套餐;
     * 
     * @param servicePackage 服务套餐;
     * @return 结果
     */
    @Override
    public int updateServicePackage(ServicePackage servicePackage)
    {
        servicePackage.setUpdateTime(DateUtils.getNowDate());
        return servicePackageMapper.updateServicePackage(servicePackage);
    }

    /**
     * 批量删除服务套餐;
     * 
     * @param ids 需要删除的服务套餐;主键
     * @return 结果
     */
    @Override
    public int deleteServicePackageByIds(Long[] ids)
    {
        return servicePackageMapper.deleteServicePackageByIds(ids);
    }

    /**
     * 删除服务套餐;信息
     * 
     * @param id 服务套餐;主键
     * @return 结果
     */
    @Override
    public int deleteServicePackageById(Long id)
    {
        return servicePackageMapper.deleteServicePackageById(id);
    }
}
